From: Keir Fraser Date: Tue, 16 Jun 2009 10:00:29 +0000 (+0100) Subject: xend: allow config file compatibility with new tap syntax X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13782 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=51e4a7555d67734dfca37869195cc8eca7315a47;p=xen.git xend: allow config file compatibility with new tap syntax Recently the format of the tap syntax in the config file changed to using a 4 part specifier (tap:tapdisk::) instead of the old 3-part one (tap::). This breaks compatibility with existing config files: a guest start will throw a Python exception and will be aborted. AFAICS currently tap:tapdisk is redundant, so the attached patch simply catches the above mentioned exception and tries to parse the old format in this case. Signed-off-by: Andre Przywara --- diff --git a/tools/python/xen/xend/server/BlktapController.py b/tools/python/xen/xend/server/BlktapController.py index 7c592932c2..59fb2f78aa 100644 --- a/tools/python/xen/xend/server/BlktapController.py +++ b/tools/python/xen/xend/server/BlktapController.py @@ -120,8 +120,12 @@ class BlktapController(BlkifController): def createDevice(self, config): - uname = config.get('uname', '') - (typ, subtyp, params, file) = string.split(uname, ':', 3) + uname = config.get('uname', '') + try: + (typ, subtyp, params, file) = string.split(uname, ':', 3) + except: + (typ, params, file) = string.split(uname, ':', 2) + subtyp = 'tapdisk' if typ in ('tap'): if subtyp in ('tapdisk'): if params in ('ioemu', 'qcow2', 'vmdk', 'sync'):